check height of the tree