fix error handling in scraper