fix typo and clean up main.js a bit