added query-only option