replaced parseChunk with getChunk to support output modifiers