Use href not pathname.