Fix to events.js