Update main.js

Trial to fix a bug...