added support for base64 encoding