Add a save action after entering the background