you are allowing a Criteria object bere but not in countAll