Pull $query when needed