Promise polyfill bug fix