convert jQuery Deferred/promise to Promise