Updated filter to ensure distinct record count