Should use pathname instead of path, since path can also contain query string