fixed crappy scoping/json stuff