Found bug in events.js