             else if socket?
                 @_sockets[opts.session_uuid] = socket
                 socket.history = undefined
-            opts.cb(err, socket)
+                opts.cb(false, socket)
         )
 
     # Connect the client with a console session, possibly creating a session in the process.

                    # one client (and upstream) at a time.
                    cb(err)
                else  # all other errors should reconnect first.
                    winston.debug("sync: reconnecting...")
                    @reconnect () =>
                        cb(err)
            else
                winston.debug("codemirror session local hub sync -- pushed edits, thus completing cycle")
                if before != @diffsync_server.live

    opts = defaults opts,
        port         : required
        secret_token : required
        timeout      : 10
        cb           : required

    socket = misc_node.connect_to_locked_socket
        port  : opts.port
        token : opts.secret_token
        timeout : opts.timeout
        cb    : (err) =>
            if err
                opts.cb(err)
