add all the ids for tree