change the timer to therading.Thread