add retry mechanism for rpc call