         }
         else
         {
-          if (currentblock == 24)
-          {
+          if (currentblock == 24 || currentblock == 26 )
+          {
+           nfc.mifareclassic_ReadDataBlock(currentblock, data); 
+           data[6] = balance[0];
+           data[7] = balance[1];
             success = nfc.mifareclassic_WriteDataBlock(currentblock, data);
             if (success)
             {

      Serial.println("Ooops ... this doesn't seem to be a Mifare Classic card!");
    }
  }
  // Wait a bit before trying again
//  Serial.println(savedData[0], HEX);
 // Serial.println(savedData[1], HEX);
  
  lcd.clear();
  lcd.print("Balance :");
  lcd.setCursor(0,1);
  lcd.print(currentBalance);
  Serial.println(currentBalance, DEC);
  Serial.println("\n\nDONE ! waiting 4 the button");
  digitalWrite(writeLedPin, LOW);
  wait4button();

  uint8_t currentblock;                     // Counter to keep track of which block we're on
  bool authenticated = false;               // Flag to indicate if the sector is authenticated
  uint8_t data[16] = {0x04, 0x0A, 0x52, 0x18, 0x7B, 0x2C, 0x10, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x55, 0x43};                         // Array to store block data during reads
  uint8_t savedData[16];

  int newBalance = encoderWrite() * 100;
  
  Serial.print("New value = ");Serial.println(newBalance);
  uint8_t balance[] = {0, 0};
  balance[0] = newBalance / 256;
  balance[1] = newBalance - (balance[0] * 256);
  Serial.print("Hex 1 = ");Serial.println(balance[0], HEX);
  Serial.print("Hex 2 = ");Serial.println(balance[1], HEX);
  digitalWrite(writeLedPin, HIGH);
