Scope problem fixed