fixes to the saving process