Adding support for promises