Is this right to first try to `resolve` the deferred then `reject` it later? That doesn't seem desired...or even possible to change the promise state at a later time.