fix trie iteration