Fixed parsing an array of hosts to connect