change Thread to Timer