closing write streams when no longer needed