bug fix for base64 encoding