another fix for memory buildup in the batch-inserter