Make sure promises are resolved with the proper context