Update main.js

Fixed errors.