added new switch cases in events.js