finish refund function