Adding debug log in event.js