added gauge logic to update based on database count