new method added to cleanup error messages