fixed null bug in refund query