fix overlapping of trees bug