Fixed link deletion function