slight modification to saving