waiting for working threads before termination added
queue for string messages from threads added
sync bug fixed