fix for empty stream