custom callbacks for connect terminate and accept events