modified the click event