loop bug cannot advance to step 3