fix finishWriting warning