fix bug for stream