Got things working for base query