added more error handling to scraper.pm