Updated spawnConnection method