save memories everytime save button is pressed