fixed scraping code to get term