modify path expression and fix pep8 question