handle missing newline after last row