fixed stream bug