implementing multipart writing for breaking up large messages