Change references of ChunkWriter to reference the writeStmts instance of the class