fix #7, don't add \n to the last line of chunk if the chunk doesn't end with \n