Trying to fix bug where threads do not get destroyed...