rebuild tree