Properly return to the main activity.