Fixing problem with spawn