resolved scope correctly