Making sure that the user saves their work before leaving