add function of timer