Trim here to avoid an error from output containing a newline