@fengjingchao Ok. but what if (r.MaxInstanceNum[rep] - 1) < deps[rep]? I think you will change the deps[rep] too in this case