Change .catch to errorhandler