Promise.resolve bug fix