add and implement updateTimeFn() to make the timer update every second automatically;