while loop in worker thread block main gui