Added deleteUnpublishedRecords function