Properly exit repeat loop after calling stop