fixed a bug within the tree system