fix scoping?