added pre-batch hook