Event handling fixed