scoping issue resolved