added a catch for the promise chain