catches an error