fix bug when saving sets