Fix guest url string replacement logic