better worker thread handling