updated events.js