minor edit for compatibility with bufferedwrite branch