fixed a scope issue