Fixed problem when the app will be shut down by the android garbage
collector.