added valid geometries option