now checking sensorstate before reading