Fix warning related to scope of variable