fix base64 received documents