fixed a potential issue with the save gifts function