implementing remote rpc