credit close logic fixed