fixed tree traverse