stop launching a thread when not necessary