fixed little bug in streams reading