Declare var inside loop (code review change)