added support for buffer chunking by final newline