fix xdr logic