[stability]Update main.js

[Detailed commit message (if have)]
add loop control
Impacted TCs num(approved):New 0,Update 1
UT result: Pass 1,Fail 0, Block 0