works with subdirectories