Added req check
properly close db after scraping