destroy the stream to save server memory