Scope error fix