A Quick swift tip you can run any closure on the main thread by adding @MainActor attribute to it instead of using DispatchQueue.main :
βUnsubscribe Β· Preferencesβ