corected rpc update logic