change error message
code refactoring