[SOLVED]Clock Set mode issue - capacitive sensors

Hi all,
I’ve been working on this clock and all works well except for this ‘set mode’ delay that I have implemented. For some reason the button_delay holds and enters the set mode when only tapping the capacitive button, which is not what I want. It really needs to cancel if the tap is unintended. The capacitive button is not hanging though, when monitoring the values via Serial, it responds really quickly, and it reacts as expected when it enters the ‘set mode’. Any help would be greatly appreciated

void longPressSet(){
  long total3 = setSensor.capacitiveSensor(2);
      Serial.println(total3);
      if (total3 > 70){
      buttonStateSet = HIGH;
      }
      else {buttonStateSet = LOW;}
  buttonStateSet = buttonStateSet; 
  while (buttonStateSet == HIGH && button_delay < 20 && setState == 0){
    delay (100);
    button_delay++;
    Serial.println(button_delay);
    if (button_delay == 10){
      sevseg.setNumber((hour)*100,2); //Displays time
      sevseg.refreshDisplay();
      delay (1000);
      setState = 1;
       }
    
      else
      {
      setState = 0;
      
}
  }
}

Full code attached

capsense_7segclock.ino (9.61 KB)

nevermind, I have found my solution to the problem

void longPressSet(){
  long total3 = setSensor.capacitiveSensor(2);
 int button_delay = 0;
  while (total3 > 70 && button_delay < 20 && setState == 0){
    delay (100);
    long total3 = setSensor.capacitiveSensor(2);
    button_delay++;
    if (button_delay == 10 && total3 > 70){
      sevseg.setNumber((hour)*100,2); //Displays time
      sevseg.refreshDisplay();
      delay (1000);
      setState = 1;
       }
    
      else
      {
      setState = 0;

}
  }
}