added batch query support