fix a bug in link remove