changed the saving function for the singleton