Change local query to use query plugin