Closing of windows to get to main activity.