Adding flag to identify if the path from root to the node forms a word