Use flag to choose error strategy.
Change. Try use single buffer to all read operations for loop.