flushk issue closed. std::flush wasn't clearing the stream