Fix usage of Promise.resolve function