oh yeah, scoping in javascript sucks