Modified PrefixTree add()