fixed issue where spawn-mode was not taken care of.