add safe condition to link creation