When a verb comes just after a preposition, we must always use it in gerund.
The good thing about this rule is that it has absolutely no exceptions, which
makes it one of the few in English with this peculiarity.
He went crazy on hearing the news
I’m looking forward to going on holiday
I always dream about winning the lottery
As we can see in these examples, the verb in gerund
comes immediately after the preposition.