Discretionary credit rating and bank stability in a financial crisis