use previousLoop variable