fixed Java streaming