fixed a bug in magnetic calibration reading