loop if the period is set.