renamed parameter next to prevent shadowing of Lua next function

fixes #164