found bug — stream must be closed