fixing scoping in tests