update the tree structure