fix newElement not generating a number
fix storing new template elements with data