flush buffer before sleep instead of disable buffering at all