fix NameError. Dont forget to commit transactions