add switch to rpc