added count method to any entity