Update main.js

make it load after document ready