minor bug fix to main.js