Bugfix: Only add event handler if link exists