fix bug where it splits one byte too early