fixed NameErrors