Fixed onPause crash.