How to update tile map collider 2D quicker

I am using the A* Pathfinding Project and I need to create a new graph (thing affected by collision) while the game is running but when I do the tilemap collider 2d has not updated since I changed it last.

I either need to generate the graph later (the bad option) or update the tilemap collider before I generate the mesh. I am sure this is the problem since I can update the graph later on in the inspector and it works fine.

I tried disabling and re-enabling the collider and that seems to work at least in the editor. If anyone has a better solution that would be apreciated.