small changes
added support for chained .then calls