Fix add and remove link functionality