Closing of streams after download