re-implemented the onPause() and onRestart() methods