fix text last line with EOL char bug