         "verbose" => state.opts.verbose,
     }
     case check_auth(json, connect_json, state.opts.auth) do
-      {:noreply, to_send} ->
-        if to_send["tls_required"] && false do
+      {:ok, to_send} ->
+        if to_send["tls_required"]  && false do
           opts = []
           IO.puts "starting SSL handshake:..."
           res = :ssl.connect(state.sock, opts, state.timeout)

  
  @start_state %{state: :want_info,
                 sock: nil,
                 opts: %{tls_required: false, auth: nil,
                         verbose: false,
                         timeout: @default_timeout,
                         host: @default_host, port: @default_port,

          {:noreply, port} = res
          state = %{state | sock: port}
        end
        connect(self(), to_send)
        {:noreply, %{state | state: :connected}}
      {:error, why} -> nats_err(state, why)
    end
