Added more logic to make_stream