added onPause-Method