Add lock so links don't get added twice