diff --git a/upload/upload.sh b/upload/upload.sh
index 0bd6e76c89ce919cc92d0432da8dd14d60fdc0f8..562fdc8cad8edb5a66c31872c1b56d263c514fca 100755
--- a/upload/upload.sh
+++ b/upload/upload.sh
@@ -108,9 +108,7 @@ recids=()
 # upload the collected records with files
 for record in ${record_dirs[@]}; do
 	# create a new draft, with the specified metadata
-	recid=$(curl -sk -X POST -H "${json_header}" -H "${auth_header}" -d @${record}/metadata.json ${base_url}/api/records | jq ".id")
-	recid=${recid%\"}
-	recid=${recid#\"}
+	recid=$(curl -sk -X POST -H "${json_header}" -H "${auth_header}" -d @${record}/metadata.json ${base_url}/api/records | jq -r ".id")
 	recids+=( ${recid} )
 
 	files=()