cleaning up before making an new tree