url encode key once creating url

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