onPause and onResume added - #9