fix bug when saving fields