scoping issue is fixed