Fix bug login link listener

- If existing user visits site, js error when trying to create event listener for login link
- Add conditional to only create listener if element exists