don't need this in the console
if there is a flag file, it should be at the beginning of the loop also