this should pay attention to custom error messages as well