Updated to return promise() rather than raw deferred.