             options : @_options
             cb      : (err, resp) =>
                 @_last_err = err
-                if @_closed
-                    if first
+                #console.log("query #{@_table}: -- got result of doing query", resp)
+                if first_resp
+                    first_resp = false
+                    if @_closed
                         cb?("closed")
-                        first = false
-                    return
-                #console.log("query #{@_table}: -- got result of doing query", resp)
-                if first
-                    first = false
-                    if err
+                    else if err
                         console.warn("query #{@_table}: _run: first error ", err)
                         cb?(err)
                     else if not resp?.query?[@_table]?
                         console.warn("query on #{@_table} returned undefined")
-                        cb?("got not data")
+                        cb?("got no data")
                     else
                         @_id = resp.id
+                        @_connected = true
                         #console.log("query #{@_table}: query resp = ", resp)
                         @_update_all(resp.query[@_table])
                         cb?()

        # The changefeed id, when set by doing a change-feed aware query.
        @_id = undefined

        # Reconnect on connect.
        @_client.on('connected', @_reconnect)

        # Connect to the server the first time.
        @_reconnect()

                    #console.log("changefeed #{@_table} produced: #{err}, ", resp)
                    # changefeed
                    if err
                        @_connected = false
                        if err != 'killfeed'    # killfeed is expected and happens regularly (right now)
                            console.warn("query #{@_table}: _run: not first error -- ", err)
                        @_reconnect()
