add name attributes on generated element