Added support for promises.