Fix global leaked variable 'arr'

Added declaration at top of method.