fixing deleteLink function