better stopping of server and wait for processes to finish up before starting the next one