Deinit and MainActor

Another possible solution by using DispatchQueue.main.sync