use location.path() instead of location.url()