works but broke

I'm not sure what is breaking the script, I think the tech switch is
overriding the can upgrade function. But I'm not 100% on it...