fixing errors in scrapping code after redo