modified trie_add to not add already existing elements