Getting weird lines when using mesh distance fields

I’m using the DistanceToNearestSurface node in my material to create foam but they’re cut short by these lines. I looked it up and I think this is the border of the distance field, and if so, is there any way I can increase the distance from the surface so the foam can properly spread out? Any other solution would also be welcome.

distancefield