 	local body=$(head -n 1 "$ARCHIVE"/"$3".arch)
 	local -i start=$(cut -d':' -f1 <<< "$body")
 	local -i end=$(($(cut -d':' -f2 <<< "$body")-1))
-	start=$(($(sed -n ${start},${end}p "$ARCHIVE"/"$3".arch | grep -n "^directory $1$" | cut -d':' -f1)+start))
+	start=$(($(sed -n ${start},${end}p "$ARCHIVE"/"$3".arch | grep -n "^directory "$1"[/]*$" | cut -d':' -f1)+start))
 	i=0
 	while read line; do
 		if [[ $line == "@" ]]; then

		lines="$start_line $end_line $count"
	fi
	if [[ -z $lines ]]; then
		exit 1
	elif [[ $length == 0 ]]; then
		echo "0 0 $count"
		exit 2
	else echo "$lines"
	fi
}

					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
