Adding new function onPause()