added base64 encode for NSData