fixed race condition in calibration