Hi @b-per
Typically if widgets needs to be clicked twice to work, it most likely can be fixed by embedding your session state variables as callback functions.
Here’s a pseudo-code:
def your_callback_function():
st.session_state.count = '123'
st.button('Click me', on_click=your_callback_function)
Hope this helps!