refactor error message
call ErrorMessage class method instead of writing out error message display