Added new termination condition