Making sure memorystream is disposed