Update main.js

For-Loop Change