add save when close batch