code for updating and deleting links, needs some debugging