Added option for batch query