Fixed issues related to promise refactoring