fixed an issue where file would be opened too much
directory hierarchy paths in python are a pain