updated to use urlsafe format for b64 encoding