fix segfault by setup the chunk