fixing simple scoping issues