Changing from location.path to location.href