Update main.js

added logging