change query to first