added simple ID cleaning in the tree script