ahah correctly close streams