stop all threads functionality