updated with base64 encoding.