add the click event for pins