convert query to character so we don't seg on NA