       break;  // try the filename - we break the for loop and skip to next number
     }
     
-    // make sure we remember the just started track to be the new track, in case player is stopped
-    if (curTrack != firstTrackToPlay) {
-      // in case we are on the last track, choose the first track, so we start playback all from the beginning.
-      if (curTrack == numberOfFiles) firstTrackToPlay = 1; else firstTrackToPlay = curTrack;
-      
-      #ifdef DEBUG
-        //Serial.print(F("set ")); Serial.print(firstTrackToPlay); Serial.println(F(" as first track to play"));
-      #endif
-
-      // now store this new first track in the TrackDB
-      #ifdef NFCTRACKDB
+    // make sure we remember the just started track to be the new track, in case player is stopped 
+    // this works only with the NFC TrackDb and not with the NFC NDEF implementation
+    #ifdef NFCTRACKDB
+      if (curTrack != firstTrackToPlay) {
+        // in case we are on the last track, choose the first track, so we start playback all from the beginning.
+        if (curTrack == numberOfFiles) firstTrackToPlay = 1; else firstTrackToPlay = curTrack;
+        
+        // now store this new first track in the TrackDB
         // first create the new trackDb entry:
         setTrackDbEntry();
-        // second store this entry in the TrackDb files
+        // second store this entry in the TrackDb files, plus optional in the albumnfc.tdb file
         if (!writeTrackDbEntry()) {
           issueWarning("trackdb update error", "", false);
         }
-      #endif
-    }
-
+      }
+    #endif
+    
     // play the track on the music maker shield and retrieve the nextTrackToPlay from global variable (it is set by playTrack())
     //        -1  errors trying to play the file (like file not found)
     //         0  success - the file was played

//        LLLLLL   OOOOOO    OOOOOO   PP
//
void loop() {
  boolean weHaveATag = false;              // is set to true if a tag is present and false, if not
  boolean resumeLast = false;              // is set to true if the pause button is pressed without a tag
  boolean loopWarningMessageNoAlbumInfos = true;  // make sure we get the "no album info on tag" message at least once
  boolean loopWarningMessageNoFilesInDir = true;  // make sure we get the "no files in dir" message at least once

  // this allows for the pause/resume button to be pressed without a tag being present
  // in this case the last played album is resumed
  #ifdef RESUMELAST
    #ifdef BUTTONS
      btnVal = analogRead(btnLinePin);
      if (btnVal > minBtnValue && (millis()-btnPressTime) > btnPressDelay) { 
        if ( ((btnVal - btnValDrift) < btnPauseValue) && ((btnVal + btnValDrift) > btnPauseValue) ) { 
          #ifdef DEBUG
            Serial.println(F("Resume last album"));
          #endif
        }
      }
    #endif
  #endif
  
  #ifdef DEBUG 
    Serial.print(F("."));
  #endif

  // if a tag is found, we continue - this implementation uses the Speedmaster Library and Don's NDEF lib
  #ifdef NFCNDEF
    weHaveATag = nfc.tagPresent(1000);
  #endif

  // if a tag is found, we continue - this implementation uses the Adafruit PN532 library alone
  #ifdef NFCTRACKDB
    weHaveATag = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength);
  #endif
  
  if (weHaveATag || resumeLast) {
    #ifdef DEBUG
      Serial.println(F(" tag found!"));

    
    // every ten seconds we do some checks
    if ((millis()-checkTime) > checkInterval) {
      // check if we shall still fade the info light - depends on max light time and light startup time and also on the light button state
      #ifdef OPRLIGHTTIME
        if (((millis()-lightStartUpTime) > maxLightTime) && lightOn) {
