better handling of save