fixing the click event