fixed trie lookup bug