# Detect an Account Change

When a user switches their account to another one, the information that the web application has initially retrieved may not match the current account. To display the correct information and request transaction approvals to the matching account, the web application must track account changes happening on Adena with the function below.

#### Code

```javascript
adena.On("changedAccount", (address: string) => void);
```

#### **Params**

<table><thead><tr><th width="173">Key</th><th width="286.3333333333333">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>key</code></td><td>'<code>changedAccount'</code></td><td>The event key of the '<code>changedAccount'</code></td></tr><tr><td><code>function</code></td><td><code>(address: string) => void</code></td><td>The function that gets triggered by the event</td></tr></tbody></table>

#### Sample Request

```javascript
//this will emit an account change when the user switches the current account on Adena
adena.On("changedAccount", (address) => {
  console.log("changed address is " + address);
});
```
