English Translation
What did he think of, when saying that?
Shouldn’t that be “woran dachte er, als er das sagte”?
What did he think of, when saying that?
Shouldn’t that be “woran dachte er, als er das sagte”?
Both versions are okay.
Yours is a bit more formal.