tree nodes logic changed