fixed up the template editing/creation