~るときに — when (before doing)