check validity of word