Fix the logic of the new symlink function