Changing the quit function to a back function