Fixing block scope issue