Link's value can be function

changed method value(link), added checking typeof link.value === 'function'