add atomic switch for batches