add early termination