small changes in main.js, fixed minor bug