bug fix in allocating buffer size when encoding NSData to base 64