Added support for subdirectories