changes to activity life cycle to stop it from crashing when leaving the main game activity.