Fix event handling on server