Arduino nano not waking up from sleep(idle)

The below code is designed to put the atmega into sleep (SLEEP_MODE_IDLE) and wake up periodically using Timer1 interrupt once every second. Timer 0 (millis timer) is disabled since that wakes up the atmega unnecessarily very frequently.

The code works, but only partially. If timer 0 is permanently disabled (by commenting line 40, see comment ‘DONT REMOVE’), the wake up does not happen after 2 iterations. Now thats a problem coz I want Timer 0 permanently disabled.

Pls explain what is happening? What has sleep/wakeup got top do with Timer 0 anyway?

#include <avr/sleep.h>
uint8_t tccr0b = 0;
void setup() {
    
  cli();
  tccr0b = TCCR0B;//Save timer 0 configuration
  
  //set timer1 interrupt at 1Hz
  TCCR1A = 0;// set entire TCCR1A register to 0
  TCCR1B = 0;// same for TCCR1B
  TCNT1  = 0;//initialize counter value to 0
  // set compare match register for 1hz increments
  OCR1A = 15624;// = (16*10^6) / (1*1024) - 1 (must be <65536)
  // turn on CTC mode
  TCCR1B |= (1 << WGM12);
  // Set CS10 and CS12 bits for 1024 prescaler
  TCCR1B |= (1 << CS12) | (1 << CS10);  
  // enable timer compare interrupt
  TIMSK1 |= (1 << OCIE1A);

  set_sleep_mode(SLEEP_MODE_IDLE);
  sleep_enable();  
  
  
  sei();
  
}

volatile uint8_t x=0;

void loop() {
  // put your main code here, to run repeatedly:
  Serial.begin(115200);
  Serial.println("Woke up");
  Serial.println("x="+String(x));
  Serial.flush();delay(10);
  Serial.end();
  TCCR0B = 0; //Disable Timer 0
  sleep_cpu (); 
  TCCR0B = tccr0b ;//Restore Timer 0, DONT REMOVE
 
  
}

ISR(TIMER1_COMPA_vect){
  x++;
  

}

The problem is resolved. delay internally uses millis.
With millis timer disabled after wakeup delay stops working and the code never goes to next sleep.