use a time.Ticker instead of the time.Sleep