changed workign directly to handle symlinks