added count method for db widget