remove links before removing activity.