added onComplete to handleRepeat