Added count method to category model