How to Seal Gap Around Water Heater Vent Pipe

I recently used spray foam from a can around an exhaust pipe coming from a hot water tank in the opening of my chimney.  I was looking to close up the small gap where the exhaust pipe goes into the…