adding support for promises