Check if title is set before adding newline