escape paths before setting the location hash