add support to count elements on a collection