fix bug when addFields