added missing/lost UID check and error message