fix tree errors