we must find a valid file name before exiting this loop.