Fixed bug that would crash the app upon onStop() method calls.