 	local body=$(head -n 1 "$ARCHIVE"/"$2".arch)
 	local -i start=$(cut -d':' -f1 <<< "$body")
 	local -i end=$(($(cut -d':' -f2 <<< "$body")-1))
-	if [[ -z $(sed -n ${start},${end}p "$ARCHIVE"/"$2".arch | grep "^directory $1$") ]]; then
+	if [[ -z $(sed -n ${start},${end}p "$ARCHIVE"/"$2".arch  | grep "^directory "$1"[/]*$") ]]; then
 		echo false
 	else echo true
 	fi

		archive=$(cat "$ARCHIVE/$3.arch")
		markers=($(echo -e -n "$archive\n" | head -1 | sed -e 's/:/\n/g'))
		tree=`echo -e -n "$archive\n" | head -n $((${markers[1]}-1)) | tail -n +$((${markers[0]}))`
		minLine=$((${lines[0]}-${markers[1]}))
		if [[ $((${lines[1]}-${lines[0]})) -ne 0 ]]; then
			while read -r line; do
				array=($(echo $line))

					local file=$(get_full_path_file "$fullpath")
					local linesToDelete=$(remove_file "$path" "$file" "$archive")
					if [[ $linesToDelete -ne false ]]; then
						sed -i "$linesToDelete"d "archives/$archive.arch"
						update_markers "1" "$archive"
						echo "File $file removed."
					else
