better testing for error messages