harden dats update script.