Added some defense to local queries