APD-605: Modified code to link terms