added maxCount opt