added batch support.