curl error checking