add link detecting functionality