directories were not handled correctly