adding the click event for a pin