added count feature to repositories