Reworked scope of event handlers for secondaryscraper. Cannot find variable i, most likely an issue with iteration or array indexing