change it to loopnum

fix mistake