some streams were not properly closed