checks if a word is palindrome