Correct onDestroy logic of MainActivity.