fixed invalid tree