「After doing ~, (someone) immediately did ...」 The subject of ~ and ... is the same.
例:
1. その男はわたしの顔を見ると、すぐに逃げて行ってしまった。
When the man saw my face, he immediately ran away.
2. 先生は教室に入ってくると、すぐ試験問題を配り始めた。As soon as the teacher entered the classroom, they immediately began handing out the exam papers.
3. ゆき子は飛行機から降りると、どこかに電話をかけた。When Yukiko got off the plane, she called someone.