fixed tree saving