fixing scope error