debugging main.js behavior