handle uninstall, fix install bugs