fixed glitch with timer