If they missed you then don't change the correction I made.

It's to avoid repeating the same sound one after another and make the sentence sound a bit prettier to the ear. That's why I replaced it by lorsque. I wrote it in blue and not in red because it's not a mistake but simply because it sounds better that way.

Here's the explanation.
- j'avais cinq ans quand...
The liaison between cinq and ans sounds exactly like the following word quand.

Simply because the use of d' here doesn't make sense in French. You write [i]d'o