add missing stream.destroy() conditional