use pathname while switching environment