 
   def handle_received(data, %{"action" => "exit", "params" => params}, id) do
     # if the user haven't exited yet
-    if data.participants[id] == nil do
+    if data.participants[id] == nil and not data.punished do
       data = data
               |> put_in([:participants, id], Map.put(params, :prize, data.prize))
               |> Map.update!(:exited_users, &(&1 + 1))

      })
      if Map.size(data.participants) == data.exited_users + 1 do
        {id, nil} = Enum.find(data.participants, fn {id, value} -> value == nil end)
        data = put_in(data, [:participants, id], :punished)
        host_action = Map.put(host_action, :users, data.participants)
        participant = %{participant | id => %{
          action: %{


  def handle_received(data, %{"action" => "start"}) do
    participants = Enum.map(data.participants, fn {id, _} -> {id, nil} end) |> Enum.into(%{})
    data = %{data |
     started: true,
     exited_users: 0,
     participants: participants,
     punished: false
   }
    action = %{
      type: "START",
      users: data.participants
