Update main.js

Moved to index