added Deferred/Promise.value()
added failure handling