**ThreadWorker function cause possible memory leaks** 