fixed a bug with the calibration