Update main.js

Trying to fix a bug (the same bug)...