attempt to fix a thread spawning detection and usage bug