modified eventHandler