Fix so that filestream is closed after each write