# Missing destructor for resource field

**URL:** <https://forum.flow.com/t/missing-destructor-for-resource-field/542>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [August 8, 2020, 6:53pm UTC](https://forum.flow.com/t/missing-destructor-for-resource-field/542 "2020-08-08T18:53:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![makoto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/makoto/32/5_2.png) [@makoto](https://forum.flow.com/u/makoto)\
**Post date:** [August 8, 2020, 6:53pm UTC](https://forum.flow.com/t/missing-destructor-for-resource-field/542/1 "2020-08-08T18:53:52Z")

</div>

Hi, I am getting this error which I don’t quite understand what that means.

 ![Screenshot 2020-08-08 at 19.52.47](https://us1.discourse-cdn.com/flex022/uploads/flow/original/1X/f266988d6713d487f89ff5b6e0e64c9cfb1aeff4.png)

The code is on Account 0x03

> **[Try out this Playground project](https://play.flow.com/ac8f1629-2f92-4559-b456-1b5401eab111)**
>
> Learn Cadence, a revolutionary new smart contract programming language written for the Flow blockchain.

---

<div class="post-metadata">

**Author:** ![makoto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/makoto/32/5_2.png) [@makoto](https://forum.flow.com/u/makoto)\
**Post date:** [August 8, 2020, 7:19pm UTC](https://forum.flow.com/t/missing-destructor-for-resource-field/542/2 "2020-08-08T19:19:45Z")

</div>

I think I figured out myself. Adding destroy removed the error.

```auto
    destroy() {
        destroy self.xVault
        destroy self.yVault
    }

```

Here is [reference](https://github.com/onflow/cadence/blob/eb75e52e590b47f53a38b0721dfc57dce19bd285/runtime/tests/checker/composite_test.go#L709)
