This takes care of KeyError and creating a new Data-Type, along with checking if the dt['UID'] is empty which is needed for the fix.