added code to convert string chunk to long bytes