Callbacks for connect/disconnec.