debug code for exit RPC.