fix handling for 404 error status code