synchronize ui- and worker-thread