correct a bug of early termination