fixing NameError