Fix defect with close order in db