add name attribute for generated elements