Question: I have three methods:

```
isSixCharactersLong(event) {
    const input_len = event.target.value.length;

    if (input_len === 6) {
        this.setState({isSixCharactersLong: true})
    } else {
        this.setState({isSixCharactersLong: false})
    }
}

isAlphanumeric(event) {
    const input_str = event.target.value;

    for (let i = 0; i < input_str.length; i++) {
        const code = input_str.charCodeAt(i);
        if (!(code > 47 && code < 58) && // numeric (0-9)
            !(code > 64 && code < 91) && // upper alpha (A-Z)
            !(code > 96 && code < 123)) { // lower alpha (a-z)
            this.setState({isAlphanumeric: true});
        } else {
            this.setState({isAlphanumeric: false});
        }
    }
}

isEmpty(event) {
    event.target.value ? this.setState({inputIsBlank: false}) : this.setState({inputIsBlank: true});
}

```

What I want to do is run a function after these three methods have resolved. So then I wrote the following:

```
async handleValidation(e) {
    this.isAlphanumeric(e);
    this.isEmpty(e);
    this.isSixCharactersLong(e);
}

```

And then I have this final method that gets triggered by my React application.

```
handleOnChange = async (e) => {
    await this.handleValidation(e)
        .then(() => this.setState({code: e.target.value}))
};

```

I would think this will work, but I keep getting an error that **e is null**. Somehow, I lose the **event**.

What I believe the problem is, it's that I'm not using async and await on the correct methods.

Answer: 
you can define `el` with a default value outside the `try`:

```py
class element:
    def __init__(self, name="element", count=1):
        self.name = name
        self.count = count

def create_element(**kwargs):
    el = None
    try:
        el = element(**kwargs)
    except TypeError:
        print("You chose arguments which no element has")
    finally:
        return el

```
You can initialize the return value to some default value ***before*** executing the `try` block:

```
el = None # initialize return value to default "None"
try:
    el = element(**kwargs)
except TypeError:
    print("You chose arguments which no element has")
return el

```

Alternatively, move the return statement inside of the try-block

```
try:
    el = element(**kwargs)
    return el
except TypeError:
    print("You chose arguments which no element has")

```