fix handling of add/delete doc fields