Having issue with creating the threads, when the threads function is called it set's to infinite loop thanks in advance