fix tree generator