anchor.diff:  handle_info({replied, ReqKey, HandlerPid}, State = #state{transacts = Transacts}) ->
       ets:insert(Transacts, {ReqKey, {replied, HandlerPid}}),
       {noreply, State};
  -handle_info({free, ReqKey}, State = #state{transacts = Transacts}) ->
  -    ets:delete(Transacts, ReqKey),
  -    {noreply, State};
  -handle_info({'EXIT', _HandlerPid, normal}, State) ->
  -    {noreply, State};
  -handle_info({'EXIT', HandlerPid, _OtherReason}, State = #state{transacts = Transacts}) ->
  -    ets:match_delete(Transacts, {'_', {'_', HandlerPid}}),
  +handle_info({'EXIT', HandlerPid, _Reason}, State = #state{transacts = Transacts}) ->
  +    [ets:delete(Transacts, ReqKey) || {_, ReqKey} <- ets:take(Transacts, HandlerPid)],
       {noreply, State};
   handle_info(_Info, State) ->
       {noreply, State}.
  
positive.code:             inc_counter(Cmds, NasProp, TS2 - TS1),
              gen_udp:send(Socket, FromIP, FromPort, EncReply),
              case application:get_env(eradius, resend_timeout, 2000) of
                  0 -> 
                      ServerPid ! {free, ReqKey};
                  ResendTimeout ->
                      ServerPid ! {replied, ReqKey, self()},
                      wait_resend_init(ServerPid, ReqKey, FromIP, FromPort, EncReply, ResendTimeout, ?RESEND_RETRIES)
              end;
          {discard, Reason} ->
              lager:debug("~s From: ~s INF: Handler discarded the request ~p for reason ~1000.p",
                          [printable_peer(ServerIP, Port), printable_peer(FromIP, FromPort), Reason, ReqKey]),
              TS2 = eradius_metrics:timestamp(milli_seconds),
              inc_discard_counter(Reason, NasProp, TS2 - TS1),
              ServerPid ! {free, ReqKey};
          {exit, Reason} ->
              lager:debug("~s From: ~s INF: Handler exited for reason ~p, discarding request ~p",
                          [printable_peer(ServerIP, Port), printable_peer(FromIP, FromPort), Reason, ReqKey]),
              TS2 = eradius_metrics:timestamp(milli_seconds),
              inc_discard_counter(Reason, NasProp, TS2 - TS1),
              ServerPid ! {free, ReqKey}
      end,
      eradius_metrics:update_nas_request(pending, NasProp#nas_prop.metrics_info, -1).
  
  
negative.code:                 [] ->
                      HandlerPid = proc_lib:spawn_link(?MODULE, do_radius, [self(), ReqKey, Handler, NNasProp, ReqUDP, TS1]),
                      ets:insert(Transacts, {ReqKey, {handling, HandlerPid}}),
                      ets:insert(Transacts, {HandlerPid, ReqKey}),
                      eradius_metrics:update_nas_request(pending, NasProp#nas_prop.metrics_info, 1);
                  [{_ReqKey, {handling, HandlerPid}}] ->
                      %% handler process is still working on the request
  