How do I end an array?

Hi all,
I have been having trouble with a recent project, and was wondering if it is possible to “end” and array once it has reached a certain point. Below I have a screencap of what I’m trying to fix, I have an array of rounds which follow a curve, and are animated to move along the curve so they feed into the bottom of the model. As you can see, after a few frames the rounds start emerging from the top of the model, and I have been trying to find a way to decrease the amount of objects in the array or end it when it reaches a certain point to prevent this from happening.
Any help is greatly appreciated!

You can keyframe the count in the array modifier. This works in a last in first out manner.