Added HTTPError checking