# How to destory a KittyItemsMarket.Collection?

**URL:** <https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [April 27, 2021, 9:40am UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820 "2021-04-27T09:40:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbdez33](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/newbdez33/32/426_2.png) [@newbdez33](https://forum.flow.com/u/newbdez33)\
**Post date:** [April 27, 2021, 9:40am UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820/1 "2021-04-27T09:40:23Z")

</div>

I’m playing with Kitty-items demo and made some modifications.

When I try to destroy and re-create a KittyItemsMarket.Collection resource and it does not work.  
Here is the problem code:

```
https://flow-view-source.com/testnet/tx/ea6cd1cb24c17008f300d1210f1706b25694ce39427adbb68c159ca089e9b621

```

My code to destroy the collection:

> if let oldToken ← acct.load\<@KittyItemsMarket.Collection\>(from: KittyItemsMarket.CollectionStoragePath) {  
> destroy oldToken  
> }

What should I do?

---

<div class="post-metadata">

**Author:** ![bastian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bastian/32/183_2.png) [@bastian](https://forum.flow.com/u/bastian)\
**Post date:** [April 27, 2021, 4:52pm UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820/2 "2021-04-27T16:52:35Z")

</div>

The code looks good, what is the problem?

---

<div class="post-metadata">

**Author:** ![newbdez33](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/newbdez33/32/426_2.png) [@newbdez33](https://forum.flow.com/u/newbdez33)\
**Post date:** [April 27, 2021, 10:29pm UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820/3 "2021-04-27T22:29:18Z")

</div>

> error: failed to save object: path /storage/kittyItemsMarketCollection002 in account 0x251636ac5575c613 already stores an object  
> → 6246af60526d4be3be82a76e5efc90279adc0235f394eaaa8c04c55fd3f21d91:88:10  
> |  
> 88 | acct.save(\<-KittyItemsMarket.createEmptyCollection(), to: KittyItemsMarket.CollectionStoragePath)

I got this error. since I have destroy the old one, the new created collection should be saved, right?

---

<div class="post-metadata">

**Author:** ![bastian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bastian/32/183_2.png) [@bastian](https://forum.flow.com/u/bastian)\
**Post date:** [April 29, 2021, 11:27pm UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820/4 "2021-04-29T23:27:23Z")

</div>

I see. Are you using the emulator?

---

<div class="post-metadata">

**Author:** ![newbdez33](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/newbdez33/32/426_2.png) [@newbdez33](https://forum.flow.com/u/newbdez33)\
**Post date:** [May 6, 2021, 4:47am UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820/5 "2021-05-06T04:47:06Z")

</div>

I’m using Testnet.

---

<div class="post-metadata">

**Author:** ![Kartik](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kartik](https://forum.flow.com/u/Kartik)\
**Post date:** [July 12, 2021, 2:04pm UTC](https://forum.flow.com/t/how-to-destory-a-kittyitemsmarket-collection/1820/6 "2021-07-12T14:04:00Z")

</div>

> [@newbdez33](#):
>
> My code to destroy the collection:

Hi @newbdez33 , I am also facing the same issue. I once removed my contract and tried to redeploy it but it throws an error

error: failed to save object: path /storage/PinataPartyContract in account 0xXXXXXX already stores an object.

Can anyone help me on this one. Thanks in advance.
