fixed a bug that did not change the cal_mean