fixed doc ready bug and moved main.js link to bottom