fixed a bug in main.js