Event handling added