Making temp url creation more robust