improved LinkAttribtue code