Output duplicates AgGrid

Greetings guys ,

when selecting a variable from an st.selectbox() function it appears twice in the output

I have used SessionState and AgGrid , how to avoid this? (See second table , first 2 lines , it should be online, the rest works fine)

Also , How to put my first table in to a database and make it update each time with update in first table , I have used (st.cache() for that) ?