Fix event handler