Fix of bug introduced in event handler with the previous commit