Fixing Stream problem