Update events.js

a little modified