changed timing to update lastSensorReading