base64 logic change