added subdirectory support