Running pages on st.navigation bar makes a single page display multiple pages

Hey everyone! I’m having a problem with st.Page(), when I’m loading a page it’s displaying the previous page content and then scrolling down below it is the current selected page content, in some pages it’s even displaying multiple pages and some it doesn’t display anything, I’m using st.rerun() at the start of the page which seems to fix it but I wanted to see if there is a more efficient way of doing it

# In file app.py
page1 = st.Page(pages/page1)
page2 = st.Page(pages/page2)
page3 = st.Page(pages/page3)
# when running page 2 I see page1 content first and below it page 2
nav = st.navigation(page1,page2,page3)
nav.run()


# on pages I just run the main function at the button of the pages

main_page1()

Hi @Liron1, can you share a simplified set of pages that reproduces this issue? I wonder if it’s because of something you’re doing in one of the pages – is there a chance that page1 is importing contents from page2 and page3, or something like that? I’m not able to reproduce this issue myself.