added count method to service