fix chunking bug identified by @jakebolewski