Fixed async access issue with promises.