stupid scoping issues