Fixed onResume bugs