Solving event bubbling issue