changed onclick event handler for isAvailable and pin