termination bugfix in TEP