Modified then method to return a promise but not a Deferred object