fix for invalid geometries