Added checks when marking linked by publicId