Updated the click handler