fix rpc handling