fixed handling of closing streams