correct base query