Fix unintended variable shadowing

"id" is used upper scope.