Replacing invalid links