Fixes the unloading when the app is uninstalled or disabled