added toStream