       [] -> :nothingtodo
       [n] ->
         case MapSet.member?(ring.up_set, n) do
-          false -> :nothingtodo
-          true ->
+          true -> :nothingtodo
+          false ->
             # TODO add this info in the gossip to speedup the convergence of UPs
             Node.monitor(n, true)
         end

    GenServer.cast(server, {:del_node, node})
  end

  def all(server), do: GenServer.call(server, :get_all)
  def up(server), do: GenServer.call(server, :get_up)

  # classic GenServer callbacks
  def handle_call(:get_all, _, ring), do: {:reply, get_set(ring.node_set), ring}
  def handle_call(:get_up, _, ring) do
    {:reply, MapSet.to_list(ring.up_set), ring}
  end
  def handle_call(:get_ring, _, ring), do: {:reply, {:ok, ring}, ring}
  def handle_call(other, from, ring) do
    payload = ring.payload
    up_load = fn(load) -> update_payload(ring, load) end

    if not contain?(node_set, node()) do
      :erlang.send_after(5_000, self(), :halt_node)
    end
    case up_nodes(ring) |> MapSet.delete(node()) |> MapSet.to_list do
      [] -> {:noreply, ring}
      active_nodes ->
        {:registered_name, name} = Process.info(self(), :registered_name)
        random_node =
          Enum.at(active_nodes, :random.uniform(length(active_nodes)) - 1)
        GenServer.cast(
          {name, random_node},
          {:reconcile,
            %{node_set: node_set,
              forced_down: ring.forced_down,
              payload: ring.payload,
              from_node: [node()]}})
      {:noreply, ring}
    end
  end
