diff --git a/cdist/conf/type/__directory/gencode-remote b/cdist/conf/type/__directory/gencode-remote
index 23fa4ed3..800fc6e4 100755
--- a/cdist/conf/type/__directory/gencode-remote
+++ b/cdist/conf/type/__directory/gencode-remote
@@ -75,7 +75,7 @@ case "$state_should" in
          set_attributes=1
          cat << DONE
 rm -f "$destination"
-mkdir "$mkdiropt" "$destination"
+mkdir $mkdiropt "$destination"
 DONE
       fi