Fixed loop bug with exit condition