fixed a potential bug in the clock.