function loadThreads fixed