Adding an ifdef for error checking