I only do this as I like to learn new things myself and appreciate if people correct me.
You made a mistake in choosing to use an over a.
The way you can decide which one to use is by looking at the proceeding words first syllable sound. If it has a vowel sound you use an if it doesn’t, then you use a. It’s important to note it’s vowel sound and not just a vowel.
Examples:
A teacher
An apple
A car
An hour (note it starts with a vowel sound, but not a vowel)