Add sleeping 5 seconds for each iteration to ensure the previous process has been stopped.