updated to use urlsafe b64 encoding format