add batched function