Fixing path for $dir