fix base64 encoding