Update index.js

Debug logging