Utft buttons and menu attempt

Hi! I'm noob here so please forgive any obvious mistakes!
I'm trying to create a very simple menu just to understand how it works.
The first page will just have a single button that goes in a second page that has a single back button.
The problem is that it goes back and forth between pages if I press the first button.
Like it auto- presses the back button.
What an I doing wrong?
Thanks!

#include <UTFT.h>
#include <UTouch.h>
#include <UTFT_Buttons.h>
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t Dingbats1_XL[];
UTFT          myGLCD(ITDB32S,38,39,40,41);
UTouch        myTouch(6,5,4,3,2);
UTFT_Buttons  myButtons(&myGLCD, &myTouch);
int menu, but1, but2, pressed_button;
boolean default_colors = true;
void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);
  myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM);
  myButtons.setTextFont(BigFont);
  myButtons.setSymbolFont(Dingbats1_XL);
  Serial.begin(9600);
  menu1();
  menu = 1;
}
void menu1()
{
 myGLCD.clrScr();  
    but1 = myButtons.addButton( 10,  20, 300,  30, "Button 1");
   myButtons.drawButton(but1);
   menu = 1;
}
void menu2()
{
    myGLCD.clrScr();
   but2 = myButtons.addButton( 20,  100, 200,  30, "back");
   myButtons.drawButton(but2);
   menu = 2;
   }
void loop()
{
  while(1) 
  {
     if (myTouch.dataAvailable() == true)
    {
         pressed_button = myButtons.checkButtons();
            if (menu == 1)
      {
         if (pressed_button==but1)
         menu = 2;
         menu2();        
      }
      if (menu == 2)
      {
         if (pressed_button==but2)
         menu = 1;
         menu1();         
      }
      
    }
  }
}

Well i changed the loop function to this
Now it goes from the next page to the next page and back but then doesn't go from the main to the next page again.
I added a third page and button and it returns up to 2nd page.
It's like after it goes back it doesn't do anything although the buttons seem pressed.

void loop()

{
  while(myTouch.dataAvailable()) 
  {
               (pressed_button = myButtons.checkButtons());
       
       
        if (menu == 1)

       
      {
         if (pressed_button==but1)
         {
         menu = 2;
         menu2();    
         Serial.print(menu);
         }    
      }
      if (menu == 2)
      
       
      {
         if (pressed_button==but2)
         {
         menu = 3;
         menu3();
         Serial.print(menu);
         }         
      }
      
      if (menu == 3)

       
      {
         if (pressed_button==but3)
         {
         menu = 2;
         menu2();    
         Serial.print(menu);
         }    
      }
      
     Serial.print(menu);
  }
}