fixed bug in chi2 calculation

Fixing the chi2 calculation bug for method 2 in the upgrade samples