minor bug fixing in main.js