       _ ->
         requests = cmd.requests ++ [{:error, get_time, cmd_name, delta}]
         |> prune_requests(cmd.thresholds)
-        update_in(state, [:commands, cmd_name, :requests], requests)
+
+        cmd = %{cmd | requests: requests}
+        update_in(state, [:commands, cmd_name], cmd)
     end
   end
 


  def handle_cast({:track, :error, cmd_name, delta}, state) do
    {:noreply, mark_call_error(state, cmd_name, delta)}
  end

  def handle_call(:stop, _from, state) do
    {:stop, :normal, :ok, state}
  end

  def stop do


  def init(metrics) do
    {:ok, %{:commands => %{}, :metrics => metrics}}
  end

  def handle_call(:stop, _from, state) do
    {:stop, :normal, :ok, state}
  end

  def handle_call({:register, cmd_name, fun, thresholds}, _from, state) do
