onResume and onPause functions are added
onResume and onPause functions are added