added error handling for http error 410 and 423