update Timer.repeating to Timer.periodic