Can you add  "if(vents.len > spawncount) break" here?