Changed the condition to leave the loop