Only use query if present.