# TypeError: can't access property "on", Mautic.builderContents is undefined

**URL:** <https://forum.mautic.org/t/typeerror-cant-access-property-on-mautic-buildercontents-is-undefined/15858>\
**Category:** Development\
**Created:** [August 29, 2020, 12:39am UTC](https://forum.mautic.org/t/typeerror-cant-access-property-on-mautic-buildercontents-is-undefined/15858 "2020-08-29T00:39:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phjou](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/phjou/32/1111_2.png) [@phjou](https://forum.mautic.org/u/phjou)\
**Post date:** [August 29, 2020, 12:39am UTC](https://forum.mautic.org/t/typeerror-cant-access-property-on-mautic-buildercontents-is-undefined/15858/1 "2020-08-29T00:39:05Z")

</div>

Hi,

I wrote a piece of javascript and it is telling me that error:

```
TypeError: can't access property "on", Mautic.builderContents is undefined

```

I guess my script is executing before the Mautic core which is defining builderContents. ANy idea how I can fix this?

My script:

```
Mautic.customSlotListener = function () {

Mautic.builderContents.on('slot:change', function (event, params) {
// CODE.
});

};

mQuery(function () {
  Mautic.customSlotListener();
});

```

Thanks to anyone trying to help me.
