Fix invalid loop bug