fixing scoping again, maybe this time i got it right