How to hide elements base on session_state value

HI,

with st.form("my_form"):

                if 'key11' not in st.session_state:
                    service = st.text_input("Movie title", "",label_visibility="collapsed",key="service-input",placeholder="Service")
                    

                    with st.container(key="btn-container"):
                        continueBtn =st.form_submit_button("Continuer", type="primary")
                        if continueBtn:
                            st.write("slider", "slider_val", "checkbox", "checkbox_val")
                            st.session_state['key11']=1

                elif 'key11' in st.session_state and st.session_state['key11']==1 :
                        email = st.text_input("Movie title", "",label_visibility="collapsed",key="email-input",placeholder="Email")
                        with st.container(key="btn-container-connect"):
                           loginBtn = st.form_submit_button("login", type="primary")

           

I dont know why I need to click on the bouton two times to hide the elements based on the condition in the IF clause, any one have any idea please ?