Fixed bug when adding a path segment containing slashes

urlencode would transaform the slash into a %2F resulting in an invalid url.