fix xdr scope bug

Fix xdr variable scope bug.
It will occur an error when calling the abort function.