added batching support