Fixed issue with promises.