bug fix in calibration