diff --git a/src/warden-server/sh/install.sh b/src/warden-server/sh/install.sh
index a64c639776f3c9c73db6b5a7d74354fb111509b7..220ff976ce6a6b1ce366d06505a91caeccb2ba88 100755
--- a/src/warden-server/sh/install.sh
+++ b/src/warden-server/sh/install.sh
@@ -56,12 +56,11 @@ errClean()
 	echo " -> Uninstalling server package ..."
 	for file in $(<"$manifest")
 	do
-		directory="${file%/*}"
 		rm -f "${basedir}/$file"
+		directory="${file%/*}"
 		rmdir --ignore-fail-on-non-empty "${basedir}/$directory"
-		rm -f "${basedir}/uninstall.sh"
-
 	done
+	rm -f "${basedir}/uninstall.sh"
 	cat "$err"
 	rm -f "$err"
 	echo