RFID skip my if else statement and go immediatly to void loop()

Hello,

I am working on a project that involves to make a memory game with bluetooth instead of buttons. But
before you can play with the memory game. You have to scan the right RFID-badge to get the bluetooth pin-code by listening to morse code with a buzzer that indicates the right RFID-badge. Here I add my code and a link with some pictures of my project.

https://drive.google.com/drive/folders/1L_rQ5QzZpZxSZNmpEyFXmrbWX0e1fY4m?usp=sharing

#include <SPI.h>

#include <deprecated.h>
#include <MFRC522.h>
#include <MFRC522Extended.h>
#include <require_cpp11.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int pinRST = 9;
const int pinSS = 10;
MFRC522 mfrc522(pinSS, pinRST);

int incomingByte;
int rood = 2;
int wit = 3;
int geel = 4;
int groen = 5;
int lijstGetallen[14];
int teller = 4;
int tellerr = 1;
boolean doorOfNiet = true;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  SPI.begin();
  mfrc522.PCD_Init();
  randomSeed((analogRead(0)));
  pinMode(6, OUTPUT);
  pinMode(rood, OUTPUT);
  pinMode(wit, OUTPUT);
  pinMode(geel, OUTPUT);
  pinMode(groen, OUTPUT);
  for(int a = 0; a < 14; a++){
    lijstGetallen[a] = random(2,6);
  }
  lcd.begin();
  lcd.setCursor(0,0);
  lcd.print("Luister en scan");
  lcd.setCursor(0,1);
  lcd.print("de juiste badge");
    delay(2000);
    tone(6, 500);
    delay(250);
    noTone(6);
    delay(250);
    tone(6, 500);
    delay(250);
    noTone(6);
    delay(250);
    tone(6, 500);
    delay(1000);
    noTone(6);
    delay(250);
    tone(6, 500);
    delay(1000);
    noTone(6);
    delay(500);
    tone(6, 500);
    delay(1000);
    noTone(6);
    delay(500);
}


void loop() {
  // put your main code here, to run repeatedly:
  //hier wordt de memory game afgespeeld
  while ( ! mfrc522.PICC_IsNewCardPresent()){
   
  }

  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())
  {
    return;
  }
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
     Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  content.toUpperCase();
  if (content.substring(1) == "2B 41 71 0D") //change here the UID of the card/cards that you want to give access
  {
    lcd.clear();
    digitalWrite(5, HIGH);
    delay(1000);
    digitalWrite(5, LOW);
    lcd.setCursor(0,0);
    lcd.print("proficiat, pass:");
    lcd.setCursor(0,1);
    lcd.print("1234");
   
  }
 
 else   {
    lcd.clear();
    digitalWrite(2, HIGH);
    delay(1000);
    digitalWrite(2, LOW);
    lcd.print("foute badge");
  }

  delay(2000);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("level " + (String)tellerr);
  for(int b = 0; b < teller; b++){
     digitalWrite(lijstGetallen[b], HIGH);
     delay(500);
     digitalWrite(lijstGetallen[b], LOW);
     delay(500);
  }
 
  //hier voert de gebruiker zijn gegevens
  for(int c = 0; c < teller; c++){
    while(Serial.available() <= 0){
   
     }
     if (Serial.available() > 0) {
      incomingByte = Serial.read();
      switch(incomingByte){
        case '5':
          digitalWrite(groen, HIGH);
          delay(500);
          digitalWrite(groen, LOW);
          break;
        case '4':
          digitalWrite(geel, HIGH);
          delay(500);
          digitalWrite(geel, LOW);
          break;
        case '3':
          digitalWrite(wit, HIGH);
          delay(500);
          digitalWrite(wit, LOW);
          break;
        case '2':
          digitalWrite(rood, HIGH);
          delay(500);
          digitalWrite(rood, LOW);
          break;
      }
      delay(200);
      if((incomingByte-48) != lijstGetallen[c]){
        doorOfNiet = false;
        lcd.clear();
        lcd.print("failed");
        tone(6,500);
        for(int d = 0; d < 4; d++){
          digitalWrite(rood, HIGH);
          digitalWrite(wit, HIGH);
          digitalWrite(geel, HIGH);
          digitalWrite(groen, HIGH);
          delay(250);
          digitalWrite(rood, LOW);
          digitalWrite(wit, LOW);
          digitalWrite(geel, LOW);
          digitalWrite(groen, LOW);
          delay(250);
        }
        noTone(6);
      }
   }
  }
  //blinkende lampen en buzzer indien alles juist
  delay(200);
  if(doorOfNiet){
    tellerr++;
    if(teller < 14){
       teller++;
    }
    tone(6,1000);
    digitalWrite(rood, HIGH);
    digitalWrite(wit, HIGH);
    digitalWrite(geel, HIGH);
    digitalWrite(groen, HIGH);
    delay(500);
    digitalWrite(rood, LOW);
    digitalWrite(wit, LOW);
    digitalWrite(geel, LOW);
    digitalWrite(groen, LOW);
    noTone(6);
    delay(1000);
  }
}

So my problem is that sometimes my RFID skip my if else statement.
The strangest thing is that I always have to unplug and replug my USB-cable and hoping that my RFID doesn’t skip my if else statement anymore.

Does someone have any idea how it’s possible ?