Fixing different scope error