diff --git a/scripts/start/choose_slurmConfig.R b/scripts/start/choose_slurmConfig.R
index d3db0cd49bf7bdcf3ba603d5e67e4b8f887291a1..8bf39346fb686d37e5b57b8dc4ca76c558837fab 100644
--- a/scripts/start/choose_slurmConfig.R
+++ b/scripts/start/choose_slurmConfig.R
@@ -69,3 +69,44 @@ choose_slurmConfig <- function() {
 
   return(comp)
 }
+
+# combine_slurmconfig takes two strings with SLURM parameters (e.g. "--qos=priority --time=40000") 
+# and combines them into one sting of SLURM parameters overwriting the parameters in "original" 
+# if they also exist in "update_with".
+ 
+combine_slurmConfig <- function (original, update_with) {
+  
+  # trim whitespaces
+  original <- trimws(original)
+  update_with <- trimws(update_with)
+  
+  # remove double whitespaces
+  original <- gsub("\\s+"," ",original)
+  update_with <- gsub("\\s+"," ",update_with)
+  
+  # if user chose "direct" dont update any slurm commands
+  if(update_with == "direct") return(update_with)
+
+  # ignore original if it is "direct"
+  if (original == "direct") original <- ""
+  
+  # put RHS strings into vector
+  v_update_with <- gsub("--.*=(.*)","\\1",unlist(strsplit(update_with,split=" ")))
+  # name the vector using LHS strings
+  names(v_update_with) <- gsub("--(.*)=.*","\\1",unlist(strsplit(update_with,split=" ")))
+  
+  # put RHS strings into vector
+  v_original <- gsub("--.*=(.*)","\\1",unlist(strsplit(original,split=" ")))
+  # name the vector using LHS strings
+  names(v_original) <- gsub("--(.*)=.*","\\1",unlist(strsplit(original,split=" ")))
+  
+  # remove elements from "original" that are existing in "update_with"
+  v_original <- v_original[!names(v_original) %in% "qos"]
+  
+  combined <- c(v_update_with,v_original)
+  
+  # concatenate SLURM command (insert "--" and "=")
+  res <- paste(paste0("--",names(combined),"=",combined),collapse = " ")
+  
+  return(res)
+}
diff --git a/start.R b/start.R
index e295ce8cc5f9556d4c860c51dc4af202b69845a1..f8b44aa4cb5ace4e8ae5146eee2a7f46634beba9 100755
--- a/start.R
+++ b/start.R
@@ -196,7 +196,7 @@ if ('--restart' %in% argv) {
   for (outputdir in outputdirs) {
     cat("Restarting",outputdir,"\n")
     load(paste0("output/",outputdir,"/config.Rdata")) # read config.Rdata from results folder
-    cfg$slurmConfig <- slurmConfig # update the slurmConfig setting to what the user just chose (it was being ignored before)
+    cfg$slurmConfig <- combine_slurmConfig(cfg$slurmConfig,slurmConfig) # update the slurmConfig setting to what the user just chose (it was being ignored before)
     submit(cfg, restart = TRUE)
     #cat(paste0("output/",outputdir,"/config.Rdata"),"\n")
   }
@@ -238,7 +238,7 @@ if ('--restart' %in% argv) {
     source("config/default.cfg")
 
     # Have the log output written in a file (not on the screen)
-    cfg$slurmConfig <- slurmConfig
+    cfg$slurmConfig <- combine_slurmConfig(cfg$slurmConfig,slurmConfig)
     cfg$logoption   <- 2
     start_now       <- TRUE