handle files without last char a newline