yes, seems like you need to keep the async sequence
see the following post
https://backendless.com/docs/bl-js/bl_troubleshooting.html#servercode-works-well-in-the-debug-mode-but-does-not-when-deployed-to-the-cloud