events.js fix