fixing minor bug for chi2 output