fixed the loop body error