Fix for method count without specifying $criteria but with the condition in defaultScope