terminate tree