implemented onPause to stop tracking if the app
goes out of focus.