fixing events.js