protect query