Move pause after the task in a loop.