fix the bug with the calculation of refund