pushed query to more global scope