       start_time: :calendar.universal_time
     }
 
-    messages = Agent.get(__MODULE__, fn messages -> messages end)
-    messages = Map.put(messages, delivery_tag, new_message)
-
-    # workload = Enum.reduce Map.keys(messages), [], fn(delivery_tag, workload) ->
-    #   workload ++ [%{
-    #     description: "Request:  #{delivery_tag}"
-    #   }]
-    # end
-    #Heartbeat.set_workload(workload)
-
-    Agent.update(__MODULE__, fn _ -> messages end)
-
+    Agent.update(__MODULE__, fn messages -> Map.put(messages, delivery_tag, new_message) end)
+    
     new_message
   end
 

  """
  @spec remove(String.t()) :: Map
  def remove(delivery_tag) do
    messages = Agent.get(__MODULE__, fn messages -> messages end)
    deleted_message = messages[delivery_tag]
    messages = Map.delete(messages, delivery_tag)
    
    # workload = Enum.reduce Map.keys(messages), [], fn(delivery_tag, workload) ->
    #   workload ++ [%{
    #     description: "Request:  #{delivery_tag}"
    #   }]
    # end
    #Heartbeat.set_workload(workload)

    Agent.update(__MODULE__, fn _ -> messages end)
    deleted_message
  end
end
  """
  @spec start_link() :: {:ok, pid} | {:error, String.t()} 
  def start_link() do
    Logger.debug("#{@logprefix} Starting...")
    Agent.start_link(fn -> %{} end, name: __MODULE__)
  end

