fixed even more problems that appeared with the last dir fix. seems ok now