Always make sure you have at least double of what you need, before you upgrade, especially if you volley.
Just keep volleying. I've made the mistake on upgrading as soon as I have enough cash. I'm not upgrading until I have 10B now
Right now I'm trying to wait until I have 4B, then buy 2 T4's (1.2 bil, minus 32 mil), then repeat until I have all T4's.