fix bug in utils.chunk
Generate pages added