adding constrains to the word validation