handle symlinks in recursive files function