fixed the directory parser