tree generation fix