correct the termination criteria