added batch support