Fix createUniqueId logic