Update events.js to work on deployed server