I think I fixed the quote issues with base64 encode.

Thanks @jihop for the idea!!