Fixed a bug in main.js