fixed a bug in eventHandler.js from prev commit