simplify error message handling