Thats not quite the problem.
First, let me check if I understand this.
If a unit enters rect A then units will spawn in rect B. Right?
If thats the case, and the units you spawn in rect B also are in rect A, then it'll spawn more units in rect B, which will cause a loop. (Units spawn, more units are enter the rect because you spawned them, more units spawn...)
Thats probably the bug.