anchor.diff:    Msg = {goodbye,#{},close_realm},
     case GBsent of
       false ->
  -      {send,Msg,State#state{goodbye_sent=true}};
  +      {send_stop,Msg,State#state{goodbye_sent=true}};
       _ ->
  -      ok = close_session(State),
         {stop,State}
     end;
   
  
positive.code: handle_info(Info,State) ->
    case hndl_info(Info,State) of
      {Result, OutMsg, State1} ->
        check_out_message(Result, OutMsg, State1);
      Other -> Other
    end.
  
  
negative.code:   end;
  
  hndl_msg_authed({goodbye,_Details,_Reason},#state{goodbye_sent=GBSent}=State) ->
    case GBSent of
      true ->
        {stop,State};
      false ->
        Msg = {goodbye,#{},goodbye_and_out},
        {reply_stop,Msg,#state{}}
    end;
  
  hndl_msg_authed(_Msg, State) ->
    {stop, State }.
  
  
  
  