# Coaching Overlay Event Listener

**URL:** <https://forum.8thwall.com/t/coaching-overlay-event-listener/924>\
**Category:** Technical Support\
**Created:** [March 29, 2024, 5:16pm UTC](https://forum.8thwall.com/t/coaching-overlay-event-listener/924 "2024-03-29T17:16:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Gallagher](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@Matthew\_Gallagher](https://forum.8thwall.com/u/Matthew_Gallagher)\
**Post date:** [March 29, 2024, 5:16pm UTC](https://forum.8thwall.com/t/coaching-overlay-event-listener/924/1 "2024-03-29T17:16:47Z")

</div>

In a JavaScript file, I am running a sequence of events where the user is prompted to find an image target which once found, hides the text. This uses the xrimageupdated event listener.

However, when trying to use the coaching overlay events using near-identical code, I am met with an error in the console and an infinitely spinning loading wheel of death. Any thoughts on how to fix this?

```
const removeOverlay = ({detail}) => {
  this.overlayDiv.style.display = 'none'
  mainObj.setAttribute('visible', true)
}

const coachEnd = () => {
  console.log('AHHH')
}

this.el.sceneEl.addEventListener('xrimageupdated', removeOverlay)
this.el.sceneEL.addEventListener('coaching-overlay.hide', coachEnd)

```

},

Error Message:  
%ccore:a-node:error %cFailure loading node: %c color: red color: inherit color: red TypeError: undefined is not an object (evaluating ‘this.el.sceneEL.addEventListener’)

---

<div class="post-metadata">

**Author:** ![TonyT](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/tonyt/32/88_2.png) [@TonyT](https://forum.8thwall.com/u/TonyT)\
**Post date:** [March 29, 2024, 6:15pm UTC](https://forum.8thwall.com/t/coaching-overlay-event-listener/924/2 "2024-03-29T18:15:51Z")

</div>

Looks like you have a typo in your second addEventListener (capital `L`):

`sceneEL` → `sceneEl`

---

<div class="post-metadata">

**Author:** ![Matthew\_Gallagher](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@Matthew\_Gallagher](https://forum.8thwall.com/u/Matthew_Gallagher)\
**Post date:** [March 29, 2024, 8:40pm UTC](https://forum.8thwall.com/t/coaching-overlay-event-listener/924/3 "2024-03-29T20:40:17Z")

</div>

Wow, just wow. Thank you very much.
