adding event listeners to links