fix newline insertion