Strange behavior with st.session_state

I just implemented the new feature (thanks by the way!). I use it to keep the status of some variables between sections of my app ( ()). However every time I change the section and go back to the page where I have stored the values, something strange happens with st.sidebar.write and st.sidebar.subheader, i.e. the strings are repeated.