fix base64 parsing