# removeUICallback()

Removes an already registered UI callback function.

In the below example the leave session callback is removed at some point later:

<pre class="language-javascript"><code class="lang-javascript"><strong>const leaveSessionCallback = () => {
</strong><strong>   console.log('Custom leave session logic called');
</strong><strong>   if (confirm('Are you sure you want to leave the session?')) {
</strong>      sambaFrame.leaveSession();
   }
<strong>};
</strong><strong>
</strong><strong>sambaFrame.addUICallback('leaveSession', leaveSessionCallback);
</strong><strong>
</strong><strong>//At some point later:
</strong>sambaFrame.removeUICallback('leaveSession', leaveSessionCallback);
</code></pre>

{% hint style="info" %}
This method is often used in conjunction with the [addUICallback ](https://docs.digitalsamba.com/reference/sdk/methods/adduicallback)method.
{% endhint %}
