[FIX] proper try/catch/finally of streams + small bug