fix memory leak for the last iteration, when there is no chunk. the chunk needed to be mortalized.