update template to create the Element object if needed