attempting to fix scoping