new function of checking string is a word or not