Updated the script so that it doesn't misfire when curl returns an error of 7.