Added logic to check if there is no candidate group found for grounded variables.