updated scoping issue