fix empty stream