Fix link opening on first page load