small modification to loop bugs