`arg` is nowhere defined. Did you forget a `local arg = {...}` at the start of the function?