RobotStudio event

Problem with SyncPathProcedureAsync method when I am trying to sync station paths to the VC

Options
Hi,

I have some problem with the SyncPathProcerdureAsync method from the Robotstudio API. I use that method to sync the paths from the station to the VC and the code is shown below and that code is executed on a button click. The problem is that not all paths are synchronized to the VC even though "SyncToController succeeded!" is displayed as many times as there are paths. "Module has been edited" is also displayed in the Logger as many times as there are paths. But when I open Module1, I see that not all paths have been synchronized. But sometimes the synchronization works and I cannot understand why this happen to me. I hope that someone can give me some advice about this. Maybe I am not the only one with this problem?
        private async void StationToVC()
        {

            RsTask myTask = mainstation.ActiveTask;
            RsPathProcedureCollection paths = myTask.PathProcedures;
            foreach (RsPathProcedure rspp in paths)
            {
                if (Funcs.validPathName(rspp.Name))
                {
                    try
                    {
                        if (await myTask.SyncPathProcedureAsync("Module1/" + rspp.Name, SyncDirection.ToController, new List<SyncLogMessage>()))
                        {
                            Logger.AddMessage(new LogMessage("SyncToController succeeded!"));

                        }
                        else
                        {
                            Logger.AddMessage(new LogMessage("SyncToController failed!"));
                        }

                    }
                    catch (Exception)
                    {
                        MessageBox.Show("Exception!");
                    }
                }
                else
                    MessageBox.Show(string.Format("One Rapid Symbol with the name '{0}' already exists, rename path.", rspp.Name));
            }
        } 

Regards,
Hugo