added ability to set a max number of instances per model