removing invalid links