add a count() method to Handler