added debug logging to script.js