fixed bug in main.js