State writes off $4 million of unpaid debts in the past year