error checking for when initSensor() is not called