updating the tree structure