worker thread prevents gui from freezing