the on end function is called only when things go wrong. But what about when the scraping is finished properly?