refactored validation, added one more error message