fix calibration bug