scoping issue fix