Variable 'region' was already declared in the first foreach loop, it was no longer available in the second loop due to scoping rules. Each foreach loop creates its own separate variable, but the debugger might have gotten confused or optimized out the second instance.