insert newline if needed