flushBuffer() invocation corrected