Fixed the bug in which threads won't get new functions.