added validation for words