added option to batch query