fixed uninstall mode logic