Implement our own deferred method with promise