Removing invalid links