Fix global leaked variable 'arr'

Add declaration at top of method.