rebuild tree after cleanup