changed query for spatial unit group and certificates entities