proprely handle reinstall/uninstall