string is not being passed to another class in c# wpf

I am creating a software that basically modifies a .json file based on the profile username that the user entered. All of the code successfully retrieves the file location of the .json file based on the username they entered. However, no matter what I do, I cannot pass the “autosavePath” string from the first class (which holds the path) to the second class. Additionally, I have set up a log system to try track what happened and as soon as the code in the second class starts, the string remains empty whilst the string holds the correct path in the first class.

First class:

public class firstClass
{
    public bool isValidProfile = false;
    public bool dirsExist = false;
    public string careerProfileName = "";
    public string careerProfilePath = "";
    public string autosavePath = "";
    public async Task checkProfileAsync(MainWindow mw)
    {
        rearrangeSaveDirs rearrangeDirs = new rearrangeSaveDirs();
        playerAttributes playerAttributes = new playerAttributes();
        //loading animation
        animCF anim = new animCF();
        anim.canvasLoadAnim(mw);

        await Task.Run(() =>
        {
            Thread.Sleep(2500);
        });

        await Task.Run(() => 
        {
            string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            string profilesPath = $"{appDataPath}\software\settings\cloud\saves";

            if (Directory.Exists(profilesPath))
            {
                Debug.WriteLine($"{profilesPath} exists");
                logger.log($"{profilesPath} exists");

                //check if the name the user entered into the textbox is a profile in the saves folder
                string profileName = string.Empty;
                mw.Dispatcher.Invoke(() =>
                {
                    profileName = mw.tbProfileName.Text.Trim(); 
                });


                if (string.IsNullOrWhiteSpace(profileName))
                {
                    logger.log($"User entered a non-valid career profile name: {profileName}");
                    mw.Dispatcher.Invoke(() =>
                    {
                        MessageBox.Show($"Please enter a valid career profile name.",
                                        "BCModZ", MessageBoxButton.OK, MessageBoxImage.Error);
                    });
                    isValidProfile = false;
                    logger.log("isValidProfile = false");
                }
                else
                {
                    string profilePath = Path.Combine(profilesPath, profileName);

                    if (Directory.Exists(profilePath))
                    {
                        Debug.WriteLine($"profile {profileName} exists at {profilePath}");
                        logger.log($"profile {profileName} exists at {profilePath}");

                        isValidProfile = true;
                        logger.log("isValidProfile = true");

                        careerProfileName = $"{profileName}";
                        careerProfilePath = $"{profilePath}";

                        Debug.WriteLine($"career profile set as {careerProfileName} and path set to {careerProfilePath}");
                        logger.log($"career profile set as {careerProfileName} and path set to {careerProfilePath}");

                        //make sure that the autosave files were successfully rearranged
                        
                        
                        bool success = rearrangeDirs.rearrangeAutosaves(this);
                        
                        if (success)
                        {
                            logger.log("rearrangeAutosaves function returned 'success'; setting dirsExist = true");

                            dirsExist = true;

                            

                        }
                        

                        Task.Delay(1500).Wait();
                    }
                    else
                    {
                        Debug.WriteLine($"profile {profileName} was not found at {profilePath}");
                        logger.log($"profile {profileName} was not found at {profilePath}");
                        mw.Dispatcher.Invoke(() =>
                        {
                            MessageBox.Show($"The career profile, {profileName}, does not exist. " +
                            $"Please double check if this is truly the name of your career profile, free from any spelling errors.",
                            "BCModZ", MessageBoxButton.OK, MessageBoxImage.Error);
                        });
                        isValidProfile = false;
                        logger.log("isValidProfile = false");
                    }
                }
            }
            else
            {
                Debug.WriteLine($"{profilesPath} does not exist");
                logger.log($"{profilesPath} does not exist");
                
                mw.Dispatcher.Invoke(() =>
                {
                    errorBox.sendMSB();
                });
                isValidProfile = false;
                logger.log("isValidProfile = false");
            }
        });


        
        if (isValidProfile == true && dirsExist == true)
        {
            autosavePath = rearrangeDirs.keptAutosaveDir;
            logger.log($"autosavePath = {autosavePath}");

            logger.log("isValidProfile returned true and dirsExist returned true");
            await Task.Run(() =>
            {
                Thread.Sleep(5500);
            });
            playerAttributes.attributesFilePath = autosavePath;
            MessageBox.Show($"{autosavePath}");

            anim.canvasLoadAnimOUT(mw);
            await Task.Run(() =>
            {
                Thread.Sleep(1500);
            });
            anim.canvasAnim(mw);
        }
        else
        {
            logger.log("Either isValidProfile or dirsExist didn't return true");
            anim.canvasLoadAnimOUT(mw);
        }

    }
}

And heres the second class:

public class playerAttributes
{
    //file path to the attributes file
    public string attributesFilePath = "nothing";

    private readonly Dictionary<string, string> optionMappings = new Dictionary<string, string>
    {
        
    };


    public void modifyAttributes(string option, double value)
    {
        //modify the playerAttributes.json file correspondingly to what the user selected
        logger.log($"attributesFilePath was set to {attributesFilePath}");

        if (Directory.Exists(attributesFilePath))
        {
            try
            {
                string json = File.ReadAllText(attributesFilePath);
                dynamic data = JsonConvert.DeserializeObject(json);
                string jsonKey = optionMappings[option];

                if (data.ContainsKey(jsonKey))
                {
                    data[jsonKey]["value"] = value;
                    logger.log($"jsonKey value = {value}");
                }
                else
                {
                    logger.log($"Option '{option}' not found in JSON.");
                    throw new KeyNotFoundException($"Option '{option}' not found in JSON.");
                }

                string updatedJson = JsonConvert.SerializeObject(data, Formatting.Indented);

                File.WriteAllText(attributesFilePath, updatedJson);
                logger.log($"Wrote {updatedJson} at {attributesFilePath}.");
                MessageBox.Show($"Set the {option} to {value}");
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Error modifying attributes: {ex.Message}");
                logger.log($"Error modifying attributes: {ex.Message}.");
            }
        }
        else
        {
            logger.log($"Directory attributesFilePath does not exist: {attributesFilePath}");
            errorBox.sendMSB();
        }
        
    }
}

this is what the logs showed:
6/07/2024 3:24:48 PM: rearrangeAutosaves function returned ‘success’; setting dirsExist = true

6/07/2024 3:06:48 PM: autosavePath = C:UserszrylxAppDataLocalsoftwaresettingscloudsavesZrylxautosave3
6/07/2024 3:06:48 PM: isValidProfile returned true and dirsExist returned true
6/07/2024 3:07:00 PM: attributesFilePath was set to nothing
6/07/2024 3:07:00 PM: Directory attributesFilePath does not exist: nothing

also I am using MaterialDesign for wpf if that matters

I have been sitting here for hours researching, modifying my code, and creating more logs, however, I still have absolutely no idea why this is happening. Please help.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật