Add max-count functionality