This was added to avoid getting stuck in a loop where I could not exit cleanly.