service_query was in the wrong place