using to_string instead of stream