added onPause onResume