checking for symlink first