Added Batch closing functionality.