fixed a scope bug