Fix task link logic