added tests, fixed list of dirs issue