changing logic to decide async in xdr