Added db checking for records and pruning of individual records that were greater then 5 days old