fix chunk merging