add some error handling to the http request