bugfix for missing closing parentheses when jsonstream ends