fixed bad scoping error