url encode key once creating url

fixes link generation for paths containing chars wich need to be url encoded