                         if err or not r? or r.length == 0
                             cb(err)
                         else
-                            if r?[0]?
-                                hosts = misc.keys(r[0])
+                            if r[0][0]?
+                                hosts = misc.keys(r[0][0])
                             cb()
             (cb) =>
                 dbg("hosts=#{misc.to_json(hosts)}; ensure that we have (at least) one host from each data center")

                                # b is better
                                return 1
                        # Next compare health of server
                        health_a = @servers[a.replica_id]?.health
                        health_b = @servers[b.replica_id]?.health
                        if health_a? and health_b?
                            health_a = Math.round(3.8*health_a)
                            health_b = Math.round(3.8*health_b)

                                    cb()
                    ], cb)

                async.map servers, f, (err) => cb(err)

        ], (err) => opts.cb?(err, @state)
        )
