fix: set next variable to local instead of global

Hi,
mocha detected a global, so I set it to local.
Cheers Philipp