Button Resets the whole app

Hello I am just a newbie here and i need help, the provided code used to do a certain OCR task and then display the output to the user and in order to get a feedback i use a push button for user to press if the extracted info is correct then store all the output data in csv file as a log, But the issue here that when i push the feedback button the app reset and the output of the push button return False.

if  authentication_status == False:
    st.error("Username/password is incorrect")
if authentication_status == None:
    st.error("Please enter your username and password")
if authentication_status:
        authenticator.logout('Logout', 'main', key='unique_key')       
        st.title("OCR Receipts PoC")
        uploaded_file = st.file_uploader('Upload Receipt Image', type=['jpg'], accept_multiple_files=False,
                                        disabled=False, label_visibility="visible")
        try: 
            log_df = pd.read_csv('Log.csv')
        except FileNotFoundError:
            log_df = pd.DataFrame(columns=['RecieptID','ScanDatetime','ProcessorId','ProcessorVersionId','Feedback','Comments'])
        if uploaded_file is not None:
            if st.button('Analyze'):
                st.session_state.analyze = True
                with st.spinner('Analyzing .......'):
                    #Generate a unique identifier for every uploaded photo
                    ID = str(uuid.uuid4())
                    #Save the uploaded file to a location
                    upload_folder = Path(__file__).parent / 'Receipts'
                    #Ensure the folder exists, create it if not
                    upload_folder.mkdir(parents=True, exist_ok=True)
                    # Save the uploaded file
                    saved_file_path = upload_folder / f"{ID}.jpg"
                    #Read the uploaded file to process it
                    with open(saved_file_path, "wb") as file:
                        file.write(uploaded_file.read())
                    # Call the process_document_ai function with the file path
                    PROCESSOR_ID = "XXXXX"
                    processor_version_id = None
                    #"430320c0893288f8"
                    res = process_document_ai(saved_file_path,"image/jpeg","XXXX","XX", PROCESSOR_ID, processor_version_id)
                    if not res.empty:
                        col1, col2,col3 = st.columns(3)
                        # Display the uploaded photo in the first column
                        col1.image(uploaded_file, caption="Uploaded Receipt Image", use_column_width=True)
                        # Display the result DataFrame in the second column
                        col2.write("Result:")
                        col2.dataframe(res)

                        feedback = col3.button('Press if we catch it correctly')

                        Type_Dict = {'BranchName':['supplier_name','branch'],'Date':['invoice_date','receipt_date','purchase_date'],
                                    'Total Amount':['total_amount']}
                        try:
                            new_row = pd.Series({
                            'RecieptID': ID,
                            'ScanDatetime': datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3],
                            'ProcessorId': PROCESSOR_ID,
                            'ProcessorVersionId': processor_version_id,
                            'Feedback': "Positive" if feedback else "Negative",
                            })

                        except Exception as e:
                            st.error('Error Occured !!!, Please Refresh the page and Try Again.')
                            new_row = pd.Series({
                                'RecieptID': ID,
                                'ScanDatetime': datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3],
                                'ProcessorId': PROCESSOR_ID,
                                'ProcessorVersionId': processor_version_id,
                                'Error_Message': str(e),
                                'Feedback': "Positive" if feedback else "Negative",
                                'Comments': feedback.get("text")
                            })

                        for i in range(len(res['Type'])):
                            for key, values in Type_Dict.items():
                                if res['Type'][i] in values:
                                    new_row[key] = f"{res['Value'][i]}"
                                    break                 
                        log_df = pd.concat([log_df, pd.DataFrame([new_row])], ignore_index=True)
                        log_df.to_csv('Log.csv',index=False) 
                    else:
                        st.error('Please provide a more clearer photo!')   
        else:
            pass

Be careful with buttons.