Corrected loop end