I think i've fixed it by adding a max amount of enemies to be spawned. Although i dont know if thats the problem