Add stream to library function