fixed a bug in TreeNode