fix tree rebuild