fix rebuild tree