locks added to trie, trie now is thread safe