fix bug on end of sstream crash due to "has not method end()"

I was experiencing an error using stream on missing method end, in this way we avoid that.

hope this helps.