Fix cursor in event handler