check the tree structure