attempt at preventing race conditions with max-machines-count