made it work in subdirectories