Debts of states affect credit rating