fix error checking around UID