update addField function