Logic fix in scraper