fixed the thread explosion