added promise polyfill