Added max count for queries