update switch button change the thread is runing