add terminating newlines