adding catches for HTTP errors