Replace promise.fail() to promise.catch()