fixed switch eventhandler