Added support for promises