fix the tree behavior