anchor.diff:              {reply,ok,S};
           {ok,ExistingReg} ->
               case ExistingReg of
  -               #client_reg{monref = MonRef, seq = Seq} when NewSeq >= Seq ->
  +               #client_sub{monref = MonRef, client_seq = Seq} when NewSeq >= Seq ->
                      mqtt_sub_repo:remove_sub(S#state.filter,ClientId),
                      Mon1 = maybe_demonitor_reg(MonRef,Mon),
                      Clients1 = orddict:erase(ClientId,Clients),
                      S1 = S#state{monref_idx = Mon1,clients = Clients1},
                      case orddict:size(Clients1) of
  -                       0 -> {reply,ok,S1}; %% {stop,no_clients,ok,NewState};
  +                       0 -> {stop,no_clients,ok,S1};
                          _ -> {reply,ok,S1}
                      end;
                   _ ->
  
positive.code:                 mqtt_sub_repo:clear_sub_pid(Filter,ClientId),
                  Clients1 = orddict:update(ClientId,
                                  fun(Reg) ->
                                      Reg#client_reg{monref = undefined,
                                                     pid = undefined}
                                  end,
                                  Clients),
  
negative.code: handle_call(get_live_clients, _From, S = #state{clients = Clients}) ->
      ClientPids = [
          {ClientId,QoS,Pid} ||
          {ClientId,#client_sub{pid = Pid,qos = QoS}} <- orddict:to_list(Clients), Pid =/= undefined],
      {reply, ClientPids, S};
  
  handle_call(_Request, _From, State) ->
  