add name and type attributes