Fixing issue with query flooding