Updated unique name generation to use pid