Fixed a scope bug