Check if a pin exists before using it