use a time.Ticker instead of the time.Sreep