Fix link logic