diff --git a/src/lib/repo/clone.sh b/src/lib/repo/clone.sh
index 08bded4d04583057ffe764355448b2174b9c029a..92de3515dcb1f294364f712026f56c62fc3bd289 100644
--- a/src/lib/repo/clone.sh
+++ b/src/lib/repo/clone.sh
@@ -61,7 +61,9 @@ pkgctl_repo_clone() {
 	jobs=$(nproc)
 
 	# variables
-	local command=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
+	local command
+	# split the words in _DEVTOOLS_COMMAND to array members
+	read -ra command <<< "${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}"
 	local project_path
 
 	while (( $# )); do
@@ -169,9 +171,13 @@ pkgctl_repo_clone() {
 		fi
 		# assign command options
 		if [[ -n "${VERSION}" ]]; then
-			command+=" --switch '${VERSION}'"
+			command+=("--switch" "'${VERSION}'")
 		fi
-		if ! parallel --bar --jobs "${jobs}" "${command}" ::: "${pkgbases[@]}"; then
+
+		# we clone the first element separately to prevent problems with key unlocking etc.
+		"${command[@]}" "${pkgbases[0]}"
+
+		if ! parallel --bar --jobs "${jobs}" "${command[@]}" ::: "${pkgbases[@]:1}"; then
 			die 'Failed to clone some packages, please check the output'
 			exit 1
 		fi