check count in the db