Added onPause to stop activity while displaying error message