use location.url instead of path