added logic for uninstall