the following in control.lua does in fact fix the problem
for n,p in pairs(global.belts) do
if p.name ~= "fast-factory-inlet" then
local maximum = roboport.logistic_network.get_item_count(p.name)
for i, belts in pairs(beltlist) do
if maximum > 0 and count < maximum and p.belt_speed > belts.prototype.belt_speed then --Replace
if not belts.to_be_deconstructed(force) then
local ghost = roboport.surface.create_entity{name="entity-ghost", position=belts.position, inner_name=p.name, direction = belts.direction, force=roboport.force}
table.insert(global.ghosts, ghost)
--belts.order_deconstruction(force)
count = count + 1
--game.print(count .. " " .. amount)
if count >= amount then --Out of bots.
return
end
end
end
end
end
end