fix branch generation so you don't run out