Fixed logic associated with an equality sign in function 'getWord'