Fix callibrate function