Add check for target count, to prevent publishing if an item has no targets