added support for es6 promises