catch error in success callback and redirect