changed timer to prevent overflow